package com.doit.day06

object _06_隐式转换 {

//  implicit def str2Int(ant:Ant)={
//    new snake(new Ant)
//  }

implicit def str2Int1(str:Int)={
    ""
}

implicit class snake(ant:Ant){
  def eatElephant()={
      println("i can eat elephant!!")
    }
  }

  def main(args: Array[String]): Unit = {

    implicit val a:Int = 10

    add

    val ant: Ant = new Ant
    ant.eatElephant()


  }

  def add(implicit a:Int,b:Int)={
    a+b
  }


}

class Ant


//class Fu1(){
//  def hehe()={
//    println("hehe")
//  }
//}

class Bird1() extends Fu1() {
  def fly()={
    println("飞")
  }
}


